import { Component, OnInit, Input } from "@angular/core";
import { AppGlobalService } from 'src/app/shared/service/app-global.service';

@Component({
  selector: "app-quote-info",
  templateUrl: "./quote-info.component.html",
  styleUrls: ["./quote-info.component.scss"]
})
export class QuoteInfoComponent implements OnInit {
  @Input() tagData: any;

  constructor(
    private appGlobalService: AppGlobalService
  ) {}

  ngOnInit() {
    console.log(this.tagData);
    if (localStorage.getItem('hideTips')){
      this.tagData.data.hideTips = "true";
    }
  }
  openQrcode(){
    localStorage.setItem('hideTips', 'true');
    this.tagData.data.hideTips = "true";
    if (this.tagData.data.qrcode.link) {
      const pageParams = {
        pageId: this.tagData.data.qrcode.link.target,
        params: this.tagData.data.qrcode.link.params ? this.tagData.data.qrcode.link.params : {},
        sessionId: localStorage.getItem('sessionId')
      };
      this.appGlobalService.goToForward(pageParams);
    }

  }
}
